package com.lichuandi;

import com.lichuandi.page.ArticleTask;
import com.lichuandi.page.ZhihuTask;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@MapperScan(basePackages = "com.lichuandi.dao")
public class MySpringBootMybatisApplication implements CommandLineRunner {

	/*@Autowired
	private ZhihuTask zhihuTask;*/
	@Autowired
	private ArticleTask articleTask;

	public static void main(String[] args) {
		SpringApplication.run(MySpringBootMybatisApplication.class, args);
	}

	@Override
	public void run(String... args) throws Exception {
		// 爬取知乎数据
		articleTask.crawl();

	}
}

/*
@SpringBootApplication
@MapperScan(basePackages = "com.hyzx.qbasic.dao")
public class Application implements CommandLineRunner {

	@Autowired
	private ZhihuTask zhihuTask;

	public static void main(String[] args) throws IOException {
		SpringApplication.run(Application.class, args);
	}

	@Override
	public void run(String... strings) throws Exception {
		// 爬取知乎数据
		zhihuTask.crawl();
	}
}*/
